function NoticeViewModel() {
	 
	var that = this;
 
//	that.topic = ko.observable('');
//	that.userName = ko.observable('');
//	that.chatContent = ko.observable('');
	that.message = ko.observable('');
	that.activePollingXhr = ko.observable(null);
 
	var keepPolling = true;
 
	function pollForMessages() {
		if (!keepPolling) {
			return;
		}
		var form = $("#joinChatForm");
		that.activePollingXhr($.ajax({url : getChatUrl(form), type : "GET", data : form.serialize(),
			success : function(messages) {
				console.log("messages : ", messages);
				for ( var i = 0; i < messages.length; i++) {
					//that.chatContent(messages[i].text);
					$.notify( messages[i].text, {
						  // whether to hide the notification on click
						  clickToHide: true,
						  // whether to auto-hide the notification
						  autoHide: true,
						  // if autoHide, hide after milliseconds
						  autoHideDelay: 5000,
						  // show the arrow pointing at the element
						  arrowShow: true,
						  // arrow size in pixels
						  arrowSize: 5,
						  // default positions
						  elementPosition: 'bottom left',
						  globalPosition: 'bottom right',
						  // default style
						  style: 'bootstrap',
						  // default class (string or [string])
						  className: 'info',
						  // show animation
						  showAnimation: 'slideDown',
						  // show animation duration
						  showDuration: 400,
						  // hide animation
						  hideAnimation: 'slideUp',
						  // hide animation duration
						  hideDuration: 200,
						  // padding between element and notification
						  gap: 2
						});
				}
			},
			error : function(xhr) {
				//keepPolling = false;
				//if (xhr.statusText != "abort") {
				//	console.error("Error getting chat messages: status=" + xhr.status + ", statusText=" + xhr.statusText);
				//}
			},
			complete : pollForMessages
		}));
	};
 
	function getChatUrl(form) {
		return form.attr("action");
	};
 
	that.postMessage = function() {
		if (that.message().trim() != '') {
			var form = $("#joinChatForm");
			$.ajax({url : getChatUrl(form), type : "POST", data : form.serialize(),
				error : function(xhr) {
					console.error("Error posting chat message: status=" + xhr.status + ", statusText=" + xhr.statusText);
				}
			});
			that.message('');
		};
	};
 
	pollForMessages();
};